<template>
	<view class="inner-comment-input-wrap">
		<image class="user-icon" :src="getImgUrl(userInfo.avatar)"></image>
		<view class="input-wrap">
			<image class="input-icon" src="../../static/inputIcon.png" mode=""></image>
			<input class="inner-comment-input" type="text" :focus="autoFocus" :placeholder="placeholder"  @blur="blur" confirm-type="send" @confirm="submit" v-model="replyText"/>
		</view>
	</view>
</template>

<script>
    import { mapState } from "vuex"
	export default {
		name: "alertPop",
		computed: {
		  ...mapState(['userInfo']),
		},
		props:{
			placeholder:{
				type: String,
				default: '我来说几句...'
			},
			autoFocus:{
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
                replyText:''
			};
		},
		methods: {
			blur() {
				this.$emit('blur')
			},
				
			submit(){
				this.$emit('submit',this.replyText)
			}
		}
	}
</script>

<style lang="less">
	.inner-comment-input-wrap{
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 124rpx;
		box-shadow: 0px -2rpx 0px 0px #E8EFFE;
		background-color: #fff;
		display: flex;
		align-items: center;
		padding: 0 64rpx;
		box-sizing: border-box;
		.user-icon{
			width: 64rpx;
			height: 64rpx;
			margin-right: 30rpx;
			border-radius: 50%;
		}
		.input-wrap{
			display: flex;
			align-items: center;
			width: 520rpx;
			height: 72rpx;
			border-radius: 36rpx;
			border: 2rpx solid #E4E4E4;
			background-color: #FAFAFA;
			padding:0 34rpx;
			.input-icon{
				width: 40rpx;
				height: 40rpx;
				margin-right: 24rpx;
			}
			.inner-comment-input{
				width: 386rpx;
				font-size: 26rpx;
				color: #666;
				&::placeholder{
					color: #CBCBCB;
				}
			}
		}
	}
</style>
